CLOUDSTACK-9727 Password reset discrepancy in RVR when one of the Rou…#1965
CLOUDSTACK-9727 Password reset discrepancy in RVR when one of the Rou…#1965bvbharatk wants to merge 2 commits into
Conversation
|
@bvbharatk can you format the code ? |
d953816 to
1a0e116
Compare
|
@ustcweizhou |
1a0e116 to
682d7bd
Compare
0566c76 to
98bfb94
Compare
|
Code changes LGTM |
…ter is not in Running state.
|
@bvbharatk I think the new password should be saved to one of the running routers, not all running routers. |
|
@ustcweizhou |
|
@bvbharatk Yes, you might know only the vm has sshkey attached will have the password in vm details. If the vm does not have ssh keypair, then the vm password will not saved into user_vm_details. Actually the vm password should be synced between master and backup. Saving to only one of them or saving to both of them are not working fine. |
|
@ustcweizhou I agree that ideally we should sync the password between the master and backup, For any kind of sync to work we need to know if the password was read from one of the VRs and In cases when one of the Vr is Stopped we will have to clear the password from db when it is read from the other one. These type of changes add complexity to the simple task of setting a password. The next best thing is to make sure we save the same password in both the routers. This will fix will at least solve the problem of sending the correct password even if the master and backup change state before the VM starts. Yes like you pointed out this will lead to the problem that the user might receive the old password when he stop starts the VM, In this case the user will get a notification in the UI that his password will be changed. So he at least knows what the password is and so he can log into the VM. |
|
Hi, However I was able to verify the intended behavior because of this PR, i.e. saving the password to the RVRs was successful. |
|
@bvbharatk Considering these three options, I think option 3 is best. What do you think ? |
|
@ustcweizhou I think there is a design problem here and addressing this will need some fundamental changes, so rather than trying to force fit it, i think it is better if we leave it at this state and then document this behavior. The workaround for now would be to remove the password script from he userVM once he successfully logs in. Thanks, |
|
@bvbharatk to be honest, we used option 2 on our production before and received some complain all vms' password are reset after reboot. Then we used option 3. if customer cannot get new password, they can stop vm and reset vm password again (this happens not often, because normally customer start vm sooner after vm password reset so there is no master<->backup switch in this period). Comparing these above 3 options, I do think option 3 has less impact and is more wise. VMpassword should be stored to only one place (yes I mean MASTER vr) if there is no sync. We are using password sync between master and backup in our fork now. However, I have no time to create a PR. |
|
@ustcweizhou |
| final UserVmVO userVM = userdata.getUserVM(); | ||
|
|
||
| _commandSetupHelper.createPasswordCommand(router, profile, nicVo, commands); | ||
| if (router.getRedundantState() == VirtualRouter.RedundantState.MASTER) { |
There was a problem hiding this comment.
- line 69 should be changed to
if (!router.getIsRedundantRouter() || router.getRedundantState() == RedundantState.MASTER) {
2, this works in a new isolated network ( with RVR), but not working with a new VPC (with RVR). It might because there is always a guest network in new isolated network so VRs are MASTER/BACKUP, but for VPC they are BACKUP/BACKUP. I have no idea how to fix it, maybe we do not change this part and let password stored in both......actually only the first vm in a vpc.
There was a problem hiding this comment.
@ustcweizhou
I am also not sure about the VPC behavior, so for now i will not alter the behavior for vpc networks. I have added the changes to ignore non redundant vrs and vpc vrs.
| } | ||
| return true; | ||
| } | ||
| } |
There was a problem hiding this comment.
line 781 to line 794 can be more simple like
for (final VirtualRouter router : routers) {
if (router.getState() == State.Running && (!router.getIsRedundantRouter() || router.getRedundantState() == RedundantState.MASTER)) {
return networkTopology.savePasswordToRouter(network, nic, uservm, router);
}
}
| return true; | ||
| } | ||
| } | ||
| //save password |
There was a problem hiding this comment.
save password should be moved to a seperate method, as password should be saved to user_vm_details table if it is not applied to VR, at around line 773.
There was a problem hiding this comment.
@ustcweizhou
moved this code to a method.
81273dd to
4788ad6
Compare
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no): https://www.dropbox.com/sh/r2si930m8xxzavs/AAAzNrnoF1fC3auFrvsKo_8-a?dl=0 Failed tests:
Skipped tests: Passed test suits: |
|
@ustcweizhou |
|
@ustcweizhou |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1295 |
|
Ping, any updates? I'll remove this from 4.11 milestone due to lack of engagement and discussions. |
|
@weizhouapache is this still needed in your opinion? |
|
@weizhouapache is this fixed in recent version or is this still an issue? |
|
@rhtyd |
|
Thanks @weizhouapache closing on your remark |
…ter is not in Running state.
Types of changes